home *** CD-ROM | disk | FTP | other *** search
/ Compendium Deluxe 2 / LSD and 17bit Compendium Deluxe - Volume II.iso / a / prog / arexx / zedrexx.lha / ZedREXX / Install < prev    next >
Text File  |  1994-08-09  |  12KB  |  463 lines

  1. ;******************************************************************************
  2. ; Installation script for ZedREXX
  3. ; Copyright (c) 1993-1994 Reality Check, Inc.
  4. ; Written by David N. Junod
  5. ;******************************************************************************
  6.  
  7. ; Make sure they are running 2.04 or greater
  8. (if (< (/ (getversion) 65536) 37)
  9.     (abort "You must be using Kickstart 2.04 or higher to install and use ZedREXX.")
  10. )
  11.  
  12. ; Figure out what device to install to (we don't want CD's to show up, etc...)
  13. (run "setenv zeddir SYS:" (safe))
  14. (run "zguessdev >env:zeddir" (safe))
  15. (set @default-dest (getenv "zeddir"))
  16. (delete "env:zeddir")
  17.  
  18. ;******************************************************************************
  19.  
  20. (set mode 0)
  21. (set tempdir (getassign "ZEDREXX"))
  22. (if (> (strlen tempdir) 0)
  23.     (
  24.         ; Ask the user if we are installing or removing
  25.         (set mode
  26.             (askchoice
  27.                 (prompt "ZedREXX")
  28.                 (help @askchoice-help)
  29.                 (choices "Install" "Remove")
  30.             )
  31.         )
  32.     )
  33. )
  34.  
  35. ; Set the prompt string
  36. (if mode
  37.     (set pmode "Remove")
  38.     (set pmode "Install")
  39. )
  40.  
  41. ;******************************************************************************
  42. ; Prompt for components and their directories
  43.  
  44. (set cbits
  45.     (askoptions
  46.         (prompt "Components to " pmode)
  47.         (help @askoptions-help)
  48.         (choices "ZedREXX" "Support" "Examples")
  49.         (default 7)
  50.     )
  51. )
  52.  
  53. ; Libraries
  54. (if (bitand cbits 1)
  55.     (
  56.         ; Where should the ZedREXX directory itself be made
  57.         (set appdir
  58.             (askdir
  59.                 (prompt
  60.                     "In which disk (or drawer) should the ZedREXX "
  61.                     "directory be installed or updated?"
  62.                 )
  63.                 (help @askdir-help)
  64.                 (default @default-dest)
  65.             )
  66.         )
  67.         (set @default-dest (tackon appdir "ZedREXX"))
  68.  
  69.         ; we have to create a directory for when we prompt...
  70.         (makedir @default-dest
  71.             (prompt "Creating ZedREXX application directory")
  72.         )
  73.  
  74.         ; Do everything relative to our own directory
  75.         (set libdir (tackon @default-dest "Libs"))
  76.  
  77. ;        ; Ask where the main libraries should be installed
  78. ;        (set libdir
  79. ;            (askdir
  80. ;                (prompt "Where do the Libraries belong")
  81. ;                (help @askdir-help)
  82. ;                (default "LIBS:")
  83. ;            )
  84. ;        )
  85.     )
  86. )
  87.  
  88. ; Support
  89. (if (bitand cbits 2)
  90.     (
  91.         ; Do everything relative to our own directory
  92.         (set classdir (tackon @default-dest "Classes"))
  93.  
  94. ;        ; Do they already have a CLASSES: assignment?
  95. ;        (set classdir (getassign "CLASSES"))
  96. ;        (if (= (strlen classdir) 0)
  97. ;            ; No CLASSES: assignment
  98. ;            (
  99. ;                ; See if they already have a directory called Classes
  100. ;                (set classdir "SYS:")
  101. ;                (if (= (exists "SYS:Classes") 2)
  102. ;                    (set classdir "SYS:Classes")
  103. ;                    (if (= (exists (tackon @default-dest "Classes")) 2)
  104. ;                        (set classdir (tackon @default-dest "Classes"))
  105. ;                        (
  106. ;                            ; we have to create a directory it seems
  107. ;                            (if (= @user-level 0)
  108. ;                                (
  109. ;                                    (makedir "SYS:Classes"
  110. ;                                        (prompt "Creating Classes support library directory")
  111. ;                                    )
  112. ;                                    (set classdir "SYS:Classes")
  113. ;                                )
  114. ;                            )
  115. ;                        )
  116. ;                    )
  117. ;                )
  118. ;
  119. ;                ; Now see if they want to use this directory
  120. ;                (set classdir
  121. ;                    (askdir
  122. ;                        (prompt "An assignment called CLASSES: must be made to a directory that will contain the gadget & image class libraries.  Where will that directory be?")
  123. ;                        (help @askdir-help)
  124. ;                        (default classdir)
  125. ;                    )
  126. ;                )
  127. ;            )
  128. ;            ; There is a CLASSES: assignment already
  129. ;            (
  130. ;                (set classdir
  131. ;                    (askdir
  132. ;                        (prompt "Where do the Classes Support Libraries belong")
  133. ;                        (help @askdir-help)
  134. ;                        (default "CLASSES:")
  135. ;                    )
  136. ;                )
  137. ;            )
  138. ;        )
  139. ;        (makeassign "CLASSES" classdir)
  140.  
  141.         ; Do everything relative to our own directory
  142.         (set rexxlibdir (tackon @default-dest "RexxLibs"))
  143.  
  144. ;        ; Do they already have a REXXLIBS: assignment?
  145. ;        (set rexxlibdir (getassign "REXXLIBS"))
  146. ;        (if (= (strlen rexxlibdir) 0)
  147. ;            ; No REXXLIBS: assignment
  148. ;            (
  149. ;                ; See if they already have a directory called RexxLibs
  150. ;                (set rexxlibdir "SYS:")
  151. ;                (if (= (exists "SYS:RexxLibs") 2)
  152. ;                    (set rexxlibdir "SYS:RexxLibs")
  153. ;                    (if (= (exists (tackon @default-dest "RexxLibs")) 2)
  154. ;                        (set rexxlibdir (tackon @default-dest "RexxLibs"))
  155. ;                        (
  156. ;                            ; we have to create a directory it seems
  157. ;                            (if (= @user-level 0)
  158. ;                                (
  159. ;                                    (makedir "SYS:RexxLibs"
  160. ;                                        (prompt "Creating REXX support library directory")
  161. ;                                    )
  162. ;                                    (set rexxlibdir "SYS:RexxLibs")
  163. ;                                )
  164. ;                            )
  165. ;                        )
  166. ;                    )
  167. ;                )
  168. ;
  169. ;                ; Now see if they want to use this directory
  170. ;                (set rexxlibdir
  171. ;                    (askdir
  172. ;                        (prompt "An assignment called REXXLIBS: must be made to a directory that will only contain REXX function libraries.  Where will that directory be?")
  173. ;                        (help @askdir-help)
  174. ;                        (default rexxlibdir)
  175. ;                    )
  176. ;                )
  177. ;            )
  178. ;            ; There is a REXXLIBS: assignment already
  179. ;            (
  180. ;                (set rexxlibdir
  181. ;                    (askdir
  182. ;                        (prompt "Where do the REXX Support Libraries belong")
  183. ;                        (help @askdir-help)
  184. ;                        (default "REXXLIBS:")
  185. ;                    )
  186. ;                )
  187. ;            )
  188. ;        )
  189. ;        (makeassign "REXXLIBS" rexxlibdir)
  190.     )
  191. )
  192.  
  193. ; Examples
  194. (if (bitand cbits 4)
  195.     ; Do everything relative to our own directory
  196.     (set rexxdir (tackon @default-dest "REXX"))
  197.  
  198. ;    (set rexxdir
  199. ;        (askdir
  200. ;            (prompt "Where do the Examples belong")
  201. ;            (help @askdir-help)
  202. ;            (default (tackon @default-dest "REXX"))
  203. ;        )
  204. ;    )
  205. )
  206.  
  207. ;******************************************************************************
  208. ;******************************************************************************
  209. ;******************************************************************************
  210.  
  211. (if mode
  212.         ;**********************************************************************
  213.     ; Remove
  214.         ;**********************************************************************
  215.     (
  216.         ; Are we supposed to remove the examples
  217.         (if (bitand cbits 4)
  218.             (
  219.                 (working "Removing examples")
  220.                 (run "c:delete ZEDREXX:REXX/#? all")
  221.                 (delete "ZEDREXX:REXX" (infos))
  222.             )
  223.         )
  224.  
  225.         ; Are we supposed to remove the support libraries
  226.         (if (bitand cbits 2)
  227.             (
  228.                 (working "Removing support libraries")
  229.                 (delete (tackon rexxlibdir "rexxdos.library"))
  230.                 (delete (tackon rexxlibdir "rexxutil.library"))
  231.             )
  232.         )
  233.  
  234.         ; Are we supposed to remove the application
  235.         (if (bitand cbits 1)
  236.             (
  237.                 (working "Removing ZedREXX")
  238.  
  239.                 ; Delete the key library
  240.                 (delete (tackon libdir "rciface.library"))
  241.                 (delete "c:zrx")
  242.  
  243.                 ; Delete the application directory
  244.                 (run "c:delete ZEDREXX:#? all")
  245.                 (makeassign "ZEDREXX")
  246.                 (delete @default-dest (infos))
  247.             )
  248.         )
  249.  
  250.         ; Make changes to the startup sequence
  251.         (working "Modifying the user-startup")
  252.         (set rexxlibdir (getassign "REXXLIBS"))
  253.         (startup "ZedREXX"
  254.             (prompt "Removing REXXLIBS: assignment from user-startup")
  255.             (help @startup-help)
  256.             (command "; ZedREXX 1.0 - Copyright (c) 1993-1994 Reality Check, Inc.\n")
  257.             (command ";               All Rights Reserved Worldwide\n")
  258.             (command ";\n;removed...\n")
  259.         )
  260.  
  261.         ; Don't want to use the confusing "Installation Complete" message
  262.         ; when what we really did was remove things...
  263.         (message "The \"ZedREXX\" components "
  264.              "that you specified have been successfully removed")
  265.         (exit (quiet))
  266.  
  267.         ; Flush the old libraries
  268.         (run "c/flushlibs")
  269.     )
  270.  
  271.         ;**********************************************************************
  272.     ; Install
  273.         ;**********************************************************************
  274.     (
  275.         ; Are we supposed to install application
  276.         (if (bitand cbits 1)
  277.             (
  278.                 (working "Installing ZedREXX")
  279.  
  280.                 ; Create the directory
  281.                 (makedir @default-dest
  282.                     (prompt "Creating ZedREXX directory")
  283.                     (infos)
  284.                 )
  285.                 (makeassign "ZEDREXX" @default-dest)
  286.  
  287.                 ; Install the libraries
  288.                 (copylib
  289.                     (prompt "Copying rciface.library")
  290.                     (help @copylib-help)
  291.                     (source "libs/rciface.library")
  292.                     (dest libdir)
  293.                     (confirm)
  294.                 )
  295.  
  296.                 (copyfiles
  297.                     (prompt "Copying shell commands")
  298.                     (help @copyfiles-help)
  299.                     (source "c")
  300.                     (dest (tackon @default-dest "c"))
  301.                     (all)
  302.                     (confirm)
  303.                 )
  304.  
  305. ;                (copylib
  306. ;                    (prompt "Copying zrx")
  307. ;                    (help @copylib-help)
  308. ;                    (source "c/zrx")
  309. ;                    (dest "C:")
  310. ;                    (confirm)
  311. ;                )
  312.  
  313.                 (copyfiles
  314.                     (prompt "Copying class interfaces")
  315.                     (help @copyfiles-help)
  316.                     (source "zclasses")
  317.                     (dest (tackon @default-dest "zclasses"))
  318.                     (all)
  319.                     (confirm)
  320.                 )
  321.  
  322.                 (copyfiles
  323.                     (prompt "Copying Icons")
  324.                     (help @copyfiles-help)
  325.                     (source "icons")
  326.                     (dest (tackon @default-dest "icons"))
  327.                     (all)
  328.                 )
  329.  
  330.                 (copyfiles
  331.                     (prompt "Copying Images")
  332.                     (help @copyfiles-help)
  333.                     (source "images")
  334.                     (dest (tackon @default-dest "images"))
  335.                     (all)
  336.                 )
  337.  
  338.                 (copyfiles
  339.                     (prompt "Copying ReadME")
  340.                     (help @copyfiles-help)
  341.                     (source "ReadME")
  342.                     (dest @default-dest)
  343.                     (infos)
  344.                 )
  345.  
  346.                 (copyfiles
  347.                     (prompt "Copying Press Release")
  348.                     (help @copyfiles-help)
  349.                     (source "PR")
  350.                     (dest @default-dest)
  351.                     (infos)
  352.                 )
  353.  
  354.                 (copyfiles
  355.                     (prompt "Copying Press Release")
  356.                     (help @copyfiles-help)
  357.                     (source "PR.TXT")
  358.                     (dest @default-dest)
  359.                     (infos)
  360.                 )
  361.             )
  362.         )
  363.  
  364.         ; Are we supposed to install support libraries
  365.         (if (bitand cbits 2)
  366.             (
  367.                 ; Install the support libraries
  368.                 (working "Installing support libraries")
  369.  
  370.                 (copylib
  371.                     (prompt "Copying rexxdos.library")
  372.                     (help @copylib-help)
  373.                     (source "rexxlibs/rexxdos.library")
  374.                     (dest rexxlibdir)
  375.                     (confirm)
  376.                 )
  377.  
  378.                 (copylib
  379.                     (prompt "Copying rexxutil.library")
  380.                     (help @copylib-help)
  381.                     (source "rexxlibs/rexxutil.library")
  382.                     (dest rexxlibdir)
  383.                     (confirm)
  384.                 )
  385.  
  386.                 ; Make sure the class sub-directories exist */
  387.                 (makedir classdir)
  388.                 (makedir (tackon classdir "Gadgets"))
  389. ;                (makedir (tackon classdir "Images"))
  390.  
  391.                 ; Install the classes
  392.                 (copylib
  393.                     (prompt "Copying button gadget")
  394.                     (help @copylib-help)
  395.                     (source "classes/gadgets/button.gadget")
  396.                     (dest (tackon classdir "Gadgets"))
  397.                     (confirm)
  398.                 )
  399.  
  400. ;                (copylib
  401. ;                    (prompt "Copying string gadget")
  402. ;                    (help @copylib-help)
  403. ;                    (source "classes/gadgets/string.gadget")
  404. ;                    (dest (tackon classdir "Gadgets"))
  405. ;                    (confirm)
  406. ;                )
  407. ;                (copylib
  408. ;                    (prompt "Copying label image")
  409. ;                    (help @copylib-help)
  410. ;                    (source "classes/images/label.image")
  411. ;                    (dest (tackon classdir "Images"))
  412. ;                    (confirm)
  413. ;                )
  414.             )
  415.         )
  416.  
  417.         ; Are we supposed to install examples
  418.         (if (bitand cbits 4)
  419.             (
  420.                 (working "Installing examples")
  421.                 (makedir rexxdir
  422.                     (prompt "Creating ZedREXX Examples directory")
  423.                     (infos)
  424.                 )
  425.                 (copyfiles
  426.                     (prompt "Copying examples")
  427.                     (help @copyfiles-help)
  428.                     (source "REXX")
  429.                     (dest rexxdir)
  430.                     (all)
  431.                     (infos)
  432.                     (confirm)
  433.                 )
  434.             )
  435.         )
  436.  
  437.         ; Make changes to the startup sequence
  438.         (working "Modifying the user-startup")
  439. ;        (set rexxlibdir (getassign "REXXLIBS"))
  440. ;        (set @default-dest (getassign "ZEDREXX"))
  441.         (startup "ZedREXX"
  442.             (prompt "Adding REXXLIBS: assignment to user-startup")
  443.             (help @startup-help)
  444.             (command "; ZedREXX 1.0 - Copyright (c) 1993-1994 Reality Check, Inc.\n")
  445.             (command ";               All Rights Reserved Worldwide\n")
  446.             (command (cat "Assign ZEDREXX: " @default-dest "\n"))
  447.             (command (cat "Assign REXXLIBS: ZEDREXX:RexxLibs Add\n"))
  448.             (command (cat "Assign LIBS: ZEDREXX:Libs ZEDREXX:RexxLibs ZEDREXX:Classes Add\n"))
  449.             (command (cat "Assign C: ZedREXX:c Add\n"))
  450.             (command (cat "Path ZedREXX:c Add\n"))
  451.             (command "ZEDREXX:c/AddREXXLibs >NIL: <NIL:\n")
  452.             (command "Run >NIL: <NIL: ZEDREXX:c/Subvert\n")
  453.             (command "Run >NIL: <NIL: ZEDREXX:c/zClsMgr\n")
  454.         )
  455.  
  456.         ; Get it running so they don't have to reboot to start things
  457.         (execute "dos-install")
  458.  
  459.         ; Flush the old libraries
  460.         (run "c/flushlibs")
  461.     )
  462. )
  463.